package cn.yusei.teamTribe.dao.school;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import cn.yusei.teamTribe.dao.school.po.SchoolRolePO;

@Mapper
public interface SchoolRoleDAO {

	final String USER_ROLE_SCHOOL_TABLE = " r_user_role_school ";
	
	@Select({"select user_id from ", USER_ROLE_SCHOOL_TABLE, "where school_id = #{schoolId} and role_id = #{roleId}"})
	public Integer selectTeamMaster(SchoolRolePO schoolRolePO);
	
	@Select({"select role_id from ", USER_ROLE_SCHOOL_TABLE, "where school_id = #{schoolId} and user_id = #{userId}"})
	public Integer selectRole(SchoolRolePO schoolRolePO);
	
	@Insert({"insert into ",USER_ROLE_SCHOOL_TABLE,"set user_id = #{userId},school_id = #{schoolId},role_id = #{roleId}"})	
	public void insert(SchoolRolePO schoolRolePO);
	
}
